<!--
 * @Author: your name
 * @Date: 2020-02-22 03:33:52
 * @LastEditTime: 2022-01-11 17:14:26
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \micro-repo-master\app2\src\views\Home.vue
-->
<template>
  <div class="home">
    <h1>我是8081端口</h1>
    <img alt="Vue logo" src="../assets/logo.png">
    <HelloWorld msg="Welcome to Your Vue.js App"/>
  </div>
</template>

<script>
// @ is an alias to /src
import HelloWorld from '@/components/HelloWorld.vue'
import actions from "../shared/actions"; 
export default {
  name: 'Home',
  components: {
    HelloWorld
  },
   mounted() {
    if (window.__POWERED_BY_QIANKUN__) {
      console.log('actions',actions)
      actions.onGlobalStateChange((state, prevState) => { // 监听全局状态
        //  监听到状态改变之后再将值更新到 `vuex` 中
        const { token } = state;
        console.log('token',token)
      }, true);
    }
  },

}
</script>
